﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.ServiceModel.Channels;
using System.Text;
using System.IO;

namespace LiveService
{
    [ServiceContract]
    public interface ILService
    {
        [OperationContract]
        List<Folder> getUserComputers(System.Guid userid);

        [OperationContract]
        List<Folder> getComputerFolders(System.Guid folderid);

        [OperationContract]
        List<Folder> getFolderFolders(System.Guid folderid);

        [OperationContract]
        List<File>   getFolderFiles(System.Guid folderid);

        [OperationContract]
        Folder       getFolderById(System.Guid fid);

        [OperationContract]
        bool            removeFolder(System.Guid fid);


        [OperationContract]
        List<User>   getUserFriends(System.Guid userid);

        [OperationContract]
        User         getUserProfileById(System.Guid userid);

        [OperationContract]
        User         getUserProfileByLogin(String login);

        [OperationContract]
        bool	     authenticateUser(User user);

        [OperationContract]
        bool registerNewUser(User user, String primary);

        [OperationContract]
        bool          updateUser(User user);

        [OperationContract]
        byte[] getServerFile(String ulogin, System.Guid parentid, String filename);

        [OperationContract]
        String getLastError();

        [OperationContract]
        bool createUploadedFile(System.Guid parentid, File info, byte[] datas, System.Guid idUser);

        [OperationContract]
        bool createNewFolder(User user, Folder fold);

        [OperationContract]
        string getWebFilePath(System.Guid parentid);

        [OperationContract]
        Folder getFolderParent(System.Guid curid);

        [OperationContract]
        bool InitializeUploadReceptor(ChunksInfo infos);

        [OperationContract]
        bool ReceiveUploadChunk(byte[] datas, System.Guid Parentid, LiveService.File Fileinfo, System.Guid Userid);
    }
}
